<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>CSS Environment Variables Module Level 1</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <meta content="exploring" name="csswg-work-status">
  <meta content="ED" name="w3c-status">
  <meta content="This specification defines the concept of [=environment variables=] and the &apos;&apos;env()&apos;&apos; function, which work similarly to custom properties and the &apos;&apos;var()&apos;&apos; function, but are defined globally for a document. These can be defined either by the User Agent, providing values that can be used on the page based on information the UA has special access to, or provided by the author for &quot;global&quot; variables that are guaranteed to be the same no matter where in the document they&apos;re used." name="abstract">
  <link href="../default.css" rel="stylesheet" type="text/css">
  <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
  body {
    background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat;
  }
  </style>
  <link href="https://drafts.csswg.org/css-env-1/" rel="canonical">
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
   <h1 class="p-name no-ref" id="title">CSS Environment Variables Module Level 1</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <details>
    <summary>Specification Metadata</summary>
    <div data-fill-with="spec-metadata">
     <dl>
      <dt>This version:
      <dd><a class="u-url" href="https://drafts.csswg.org/css-env-1/">https://drafts.csswg.org/css-env-1/</a>
      <dt class="editor">Editors:
      <dd class="editor p-author h-card vcard" data-editor-id="42199"><span class="p-name fn">Tab Atkins-Bittner</span> (<span class="p-org org">Google</span>)
      <dd class="editor p-author h-card vcard" data-editor-id="42080"><span class="p-name fn">Dean Jackson</span> (<span class="p-org org">Apple</span>)
      <dt>Suggest an Edit for this Spec:
      <dd><a href="https://github.com/w3c/csswg-drafts/blob/master/css-env-1/Overview.bs">GitHub Editor</a>
      <dt>Issue Tracking:
      <dd><a href="https://github.com/w3c/csswg-drafts/labels/css-env-1">GitHub Issues</a>
     </dl>
    </div>
   </details>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="https://www.keio.ac.jp/">Keio</a>, <a href="https://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">permissive document license</a> rules apply. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>This specification defines the concept of <a data-link-type="dfn" href="#css-environment-variable" id="ref-for-css-environment-variable">environment variables</a> and the <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env">env()</a> function, which work similarly to custom properties and the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-variables-1/#funcdef-var" id="ref-for-funcdef-var">var()</a> function, but are defined globally for a document. These can be defined either by the User Agent, providing values that can be used on the page based on information the UA has special access to, or provided by the author for "global" variables that are guaranteed to be the same no matter where in the document they’re used.</p>
    <a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, etc. 
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This is a public copy of the editors’ draft.
	It is provided for discussion only and may change at any moment.
	Its publication here does not imply endorsement of its contents by W3C.
	Don’t cite this document other than as work in progress. </p>
   <p> <a href="https://github.com/w3c/csswg-drafts/issues">GitHub Issues</a> are preferred for discussion of this specification.
	When filing an issue, please put the text “css-env” in the title,
	preferably like this:
	“[css-env] <i data-lt>…summary of comment…</i>”.
	All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>,
	and there is also a <a href="https://lists.w3.org/Archives/Public/www-style/">historical archive</a>. </p>
   <p> This document was produced by the <a href="https://www.w3.org/Style/CSS/">CSS Working Group</a>. </p>
   <p> This document was produced by a group operating under
	the <a href="https://www.w3.org/Consortium/Patent-Policy/">W3C Patent Policy</a>.
	W3C maintains a <a href="https://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
	that page also includes instructions for disclosing a patent.
	An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
   <p> This document is governed by the <a href="https://www.w3.org/2019/Process-20190301/" id="w3c_process_revision">1 March 2019 W3C Process Document</a>. </p>
   <p></p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li><a href="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a>
    <li>
     <a href="#environment"><span class="secno">2</span> <span class="content">Environment Variables</span></a>
     <ol class="toc">
      <li><a href="#safe-area-insets"><span class="secno">2.1</span> <span class="content">Safe area inset variables</span></a>
     </ol>
    <li>
     <a href="#env-function"><span class="secno">3</span> <span class="content">Using Environment Variables: the <span class="css">env()</span> notation</span></a>
     <ol class="toc">
      <li><a href="#env-in-shorthands"><span class="secno">3.1</span> <span class="content">Environment Variables in Shorthand Properties</span></a>
     </ol>
    <li>
     <a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
     <ol class="toc">
      <li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
      <li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
      <li>
       <a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
       <ol class="toc">
        <li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
        <li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
        <li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
       </ol>
     </ol>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
     </ol>
    <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
   </ol>
  </nav>
  <main>
   <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>
   <p>The <a data-link-type="biblio" href="#biblio-css-variables-1">[css-variables-1]</a> specification defined the concept of "cascading variables",
author-defined variables created from the value of <a data-link-type="dfn" href="https://drafts.csswg.org/css-variables-1/#custom-property" id="ref-for-custom-property">custom properties</a>,
capable of being substituted into arbitrary other properties via the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-variables-1/#funcdef-var" id="ref-for-funcdef-var①">var()</a> function.</p>
   <p>This specification defines a related, but simpler, concept of <a data-link-type="dfn" href="#css-environment-variable" id="ref-for-css-environment-variable①">environment variables</a>.
Unlike "cascading variables",
which can change thruout the page as their corresponding <a data-link-type="dfn" href="https://drafts.csswg.org/css-variables-1/#custom-property" id="ref-for-custom-property①">custom property</a> takes on different values,
an <span id="ref-for-css-environment-variable②">environment variable</span> is "global" to a particular document—<wbr>its value is the same everywhere.
The <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env①">env()</a> function can then be used to substitute the value into arbitrary locations,
similar to the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-variables-1/#funcdef-var" id="ref-for-funcdef-var②">var()</a> function.</p>
   <p>These "global" variables have both benefits and downsides versus cascading variables:</p>
   <ul>
    <li data-md>
     <p>Many variables aren’t meant to change over the course of a page;
they set up themes,
or are helpers for particular numerical values.
Using <a data-link-type="dfn" href="#css-environment-variable" id="ref-for-css-environment-variable③">environment variables</a> instead of <a data-link-type="dfn" href="https://drafts.csswg.org/css-variables-1/#custom-property" id="ref-for-custom-property②">custom properties</a> to define these
communicates the proper intent,
which is good both for the author of the document
(particularly when multiple people are collaborating on a single document),
and for the user agent,
as it can store these variables in a more optimal way.</p>
    <li data-md>
     <p>Because <a data-link-type="dfn" href="#css-environment-variable" id="ref-for-css-environment-variable④">environment variables</a> don’t depend on the value of anything drawn from a particular element,
they can be used in places where there is no obvious element to draw from,
such as in <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-conditional-3/#at-ruledef-media" id="ref-for-at-ruledef-media">@media</a> rules,
where the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-variables-1/#funcdef-var" id="ref-for-funcdef-var③">var()</a> function would not be valid.</p>
    <li data-md>
     <p>Information from the User Agent itself,
such as the margin of the viewport to avoid laying out in by default
(for example, to avoid overlapping a "notch" in the screen),
can be retrieved via <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env②">env()</a>,
whereas the element-specific nature of <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-variables-1/#funcdef-var" id="ref-for-funcdef-var④">var()</a> was not an appropriate place to pipe that information in.</p>
   </ul>
   <h2 class="heading settled" data-level="2" id="environment"><span class="secno">2. </span><span class="content">Environment Variables</span><a class="self-link" href="#environment"></a></h2>
   <p>A CSS <dfn class="dfn-paneled" data-dfn-for="CSS" data-dfn-type="dfn" data-noexport id="css-environment-variable">environment variable</dfn> is a name associated with a <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-syntax-3/#typedef-declaration-value" id="ref-for-typedef-declaration-value">&lt;declaration-value></a> (a sequence of zero more CSS tokens, with almost no restrictions on what tokens can exist),
similar to a <a data-link-type="dfn" href="https://drafts.csswg.org/css-variables-1/#custom-property" id="ref-for-custom-property③">custom property</a>. <a data-link-type="dfn" href="#css-environment-variable" id="ref-for-css-environment-variable⑤">Environment variables</a> can be defined by the User Agent,
or by the user.
(In the latter case, the names are <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-variables-1/#typedef-custom-property-name" id="ref-for-typedef-custom-property-name">&lt;custom-property-name></a>s,
and start with `--` per standard for custom identifiers.)</p>
   <p class="issue" id="issue-c17a17b4"><a class="self-link" href="#issue-c17a17b4"></a> Is the set of UA-defined <a data-link-type="dfn" href="#css-environment-variable" id="ref-for-css-environment-variable⑥">environment variables</a> visible to script?
If so, define an API on <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document" id="ref-for-document">Document</a></code> to expose them.</p>
   <p class="issue" id="issue-ed0904e4"><a class="self-link" href="#issue-ed0904e4"></a> Define how authors can add <a data-link-type="dfn" href="#css-environment-variable" id="ref-for-css-environment-variable⑦">environment variables</a>,
preferably both via JS
and via CSS.
Note that mixing CSS rules and JS-defined stuff can easily get messy,
as demonstrated by CSSFontFaceRule vs FontFace...</p>
   <p>The following UA-defined <a data-link-type="dfn" href="#css-environment-variable" id="ref-for-css-environment-variable⑧">environment variables</a> are officially defined and must be supported.
Additional UA-defined <span id="ref-for-css-environment-variable⑨">environment variables</span> *must not* be supported
unless/until they are added to this list.</p>
   <div>
    <ul class="index"></ul>
   </div>
   <h3 class="heading settled" data-level="2.1" id="safe-area-insets"><span class="secno">2.1. </span><span class="content">Safe area inset variables</span><a class="self-link" href="#safe-area-insets"></a></h3>
   <table>
    <tbody>
     <tr>
      <th>Name 
      <th>Value 
     <tr>
      <td><dfn class="css" data-dfn-for="env()" data-dfn-type="value" data-export id="valdef-env-safe-area-inset-top">safe-area-inset-top<a class="self-link" href="#valdef-env-safe-area-inset-top"></a></dfn> 
      <td><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length></a> 
     <tr>
      <td><dfn class="css" data-dfn-for="env()" data-dfn-type="value" data-export id="valdef-env-safe-area-inset-right">safe-area-inset-right<a class="self-link" href="#valdef-env-safe-area-inset-right"></a></dfn> 
      <td><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value①" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length></a> 
     <tr>
      <td><dfn class="css" data-dfn-for="env()" data-dfn-type="value" data-export id="valdef-env-safe-area-inset-bottom">safe-area-inset-bottom<a class="self-link" href="#valdef-env-safe-area-inset-bottom"></a></dfn> 
      <td><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value②" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length></a> 
     <tr>
      <td><dfn class="css" data-dfn-for="env()" data-dfn-type="value" data-export id="valdef-env-safe-area-inset-left">safe-area-inset-left<a class="self-link" href="#valdef-env-safe-area-inset-left"></a></dfn> 
      <td><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value③" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length></a> 
   </table>
   <p>The safe area insets are four <a data-link-type="dfn" href="#css-environment-variable" id="ref-for-css-environment-variable①⓪">environment variables</a> that define a rectangle by
its top, right, bottom, and left insets from the edge of the viewport. For rectangular
displays, these must all be zero, but for nonrectangular displays they must form a
rectangle, chosen by the user agent, such that all content inside the rectangle is
visible, and such that reducing any of the insets would cause some content inside of
the rectangle to be invisible due to the nonrectangular nature of the display. This
allows authors to limit the layout of essential content to the space inside of the
safe area rectangle.</p>
   <h2 class="heading settled" data-level="3" id="env-function"><span class="secno">3. </span><span class="content">Using Environment Variables: the <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env③">env()</a> notation</span><a class="self-link" href="#env-function"></a></h2>
   <p>In order to substitute the value of an <a data-link-type="dfn" href="#css-environment-variable" id="ref-for-css-environment-variable①①">environment variable</a> into a CSS context,
use the <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env④">env()</a> function:</p>
<pre class="prod"><dfn class="dfn-paneled" data-dfn-type="function" data-export id="funcdef-env">env()</dfn> = env( <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#identifier-value" id="ref-for-identifier-value">&lt;custom-ident></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma">,</a> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-syntax-3/#typedef-declaration-value" id="ref-for-typedef-declaration-value①">&lt;declaration-value></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt">?</a> )
</pre>
   <p>The <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env⑤">env()</a> function can be used in place of any part of a value in any property on any element,
or any part of a value in any descriptor on any <a data-link-type="dfn" href="https://drafts.csswg.org/css-syntax-3/#at-rule" id="ref-for-at-rule">at-rule</a>,
and in several other places where CSS values are allowed.</p>
   <div class="issue" id="issue-9ee89738">
    <a class="self-link" href="#issue-9ee89738"></a> Define the full set of places <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env⑥">env()</a> can be used. 
    <ul>
     <li data-md>
      <p>Should be able to replace any subset of MQ syntax, for example.</p>
     <li data-md>
      <p>Should be able to replace selectors, maybe?</p>
     <li data-md>
      <p>Should it work on a rule level,
so you can insert arbitrary stuff into a rule,
like reusing a block of declarations?</p>
    </ul>
   </div>
   <p>The first argument to <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env⑦">env()</a> provides the name of an <a data-link-type="dfn" href="#css-environment-variable" id="ref-for-css-environment-variable①②">environment variable</a> to be substituted.
The second argument, if provided, is a fallback value,
which is used as the substitution value
when the referenced <span id="ref-for-css-environment-variable①③">environment variable</span> does not exist.</p>
   <p class="note" role="note"><span>Note:</span> The syntax of the fallback, like that of custom properties, allows commas.
For example, <span class="css">env(foo, red, blue)</span> defines a fallback of <span class="css">red, blue</span>;
that is, anything between the first comma and the end of the function is considered a fallback value.</p>
   <p>If a property contains one or more <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env⑧">env()</a> functions,
and those functions are syntactically valid,
the entire property’s grammar must be assumed to be valid at parse time.
It is only syntax-checked at computed-time,
after <span class="css" id="ref-for-funcdef-env⑨">env()</span> functions have been <a data-link-type="dfn" href="#substitute-an-env" id="ref-for-substitute-an-env">substituted</a>.</p>
   <p>If a descriptor contains one or more <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env①⓪">env()</a> functions,
and those functions are syntactically valid,
the entire declaration’s grammar must be assumed to be valid at parse time.
It is only syntax-checked after <span class="css" id="ref-for-funcdef-env①①">env()</span> functions have been <a data-link-type="dfn" href="#substitute-an-env" id="ref-for-substitute-an-env①">substituted</a>.</p>
   <div class="algorithm" data-algorithm="substitute an env()">
     To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-local-lt="substitute" id="substitute-an-env">substitute an env()</dfn> in a property or descriptor: 
    <ol>
     <li data-md>
      <p>If the name provided by the first argument of the <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env①②">env()</a> function
is a recognized <a data-link-type="dfn" href="#css-environment-variable" id="ref-for-css-environment-variable①④">environment variable</a>,
replace the <span class="css" id="ref-for-funcdef-env①③">env()</span> function by the value of the named <span id="ref-for-css-environment-variable①⑤">environment variable</span>.</p>
     <li data-md>
      <p>Otherwise, if the <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env①④">env()</a> function has a fallback value as its second argument,
replace the <span class="css" id="ref-for-funcdef-env①⑤">env()</span> function by the fallback value.
If there are any <span class="css" id="ref-for-funcdef-env①⑥">env()</span> references in the fallback, <a data-link-type="dfn" href="#substitute-an-env" id="ref-for-substitute-an-env②">substitute</a> them as well.</p>
     <li data-md>
      <p>Otherwise, the property or descriptor containing the <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env①⑦">env()</a> function is <a data-link-type="dfn" href="https://drafts.csswg.org/css-variables-1/#invalid-at-computed-value-time" id="ref-for-invalid-at-computed-value-time">invalid at computed-value time</a>.</p>
    </ol>
   </div>
   <p class="issue" id="issue-91e85376"><a class="self-link" href="#issue-91e85376"></a> Define when substitution happens.
It has to be before <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-variables-1/#funcdef-var" id="ref-for-funcdef-var⑤">var()</a> substitution.
Alternately, should <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env①⑧">env()</a> substitution happen at parse time,
so unknown variable names cause it to fail syntax checking?
There’s no particular reason to have it happen at computed-value time,
like <span class="css" id="ref-for-funcdef-var⑥">var()</span> does—<wbr>that was to ensure that <a data-link-type="dfn" href="https://drafts.csswg.org/css-variables-1/#custom-property" id="ref-for-custom-property④">custom properties</a> could inherit their value down
before they were picked up by a <span class="css" id="ref-for-funcdef-var⑦">var()</span>.</p>
   <p class="issue" id="issue-9806265e"><a class="self-link" href="#issue-9806265e"></a> When I figure out where else <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env①⑨">env()</a> can go,
define how/when it substitutes.</p>
   <h3 class="heading settled" data-level="3.1" id="env-in-shorthands"><span class="secno">3.1. </span><span class="content">Environment Variables in Shorthand Properties</span><a class="self-link" href="#env-in-shorthands"></a></h3>
   <p class="issue" id="issue-66b99b40"><a class="self-link" href="#issue-66b99b40"></a> If <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env②⓪">env()</a> substitution happens during parsing,
then this is unnecessary.</p>
   <p>The <a class="css" data-link-type="maybe" href="#funcdef-env" id="ref-for-funcdef-env②①">env()</a> function causes the same difficulties with <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#shorthand-property" id="ref-for-shorthand-property">shorthand properties</a> as the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-variables-1/#funcdef-var" id="ref-for-funcdef-var⑧">var()</a> function does.
When an <span class="css" id="ref-for-funcdef-env②②">env()</span> is used in a <span id="ref-for-shorthand-property①">shorthand property</span>,
then,
it has the same effects as defined in <a href="https://www.w3.org/TR/css-variables-1/#variables-in-shorthands">CSS Variables 1 §3.2 Variables in Shorthand Properties</a>.</p>
  </main>
  <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
  <h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3>
  <p>Conformance requirements are expressed with a combination of
	descriptive assertions and RFC 2119 terminology. The key words “MUST”,
	“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
	“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
	document are to be interpreted as described in RFC 2119.
	However, for readability, these words do not appear in all uppercase
	letters in this specification. </p>
  <p>All of the text of this specification is normative except sections
	explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
  <p>Examples in this specification are introduced with the words “for example”
	or are set apart from the normative text with <code>class="example"</code>,
	like this: </p>
  <div class="example" id="example-ae2b6bc0">
   <a class="self-link" href="#example-ae2b6bc0"></a> 
   <p>This is an example of an informative example. </p>
  </div>
  <p>Informative notes begin with the word “Note” and are set apart from the
	normative text with <code>class="note"</code>, like this: </p>
  <p class="note" role="note">Note, this is an informative note. </p>
  <p>Advisements are normative sections styled to evoke special attention and are
	set apart from other normative text with <code>&lt;strong class="advisement"></code>, like
	this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p>
  <h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3>
  <p>Conformance to this specification
	is defined for three conformance classes: </p>
  <dl>
   <dt>style sheet 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS
			style sheet</a>. 
   <dt>renderer 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders
			documents that use them. 
   <dt>authoring tool 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet. 
  </dl>
  <p>A style sheet is conformant to this specification
	if all of its statements that use syntax defined in this module are valid
	according to the generic CSS grammar and the individual grammars of each
	feature defined in this module. </p>
  <p>A renderer is conformant to this specification
	if, in addition to interpreting the style sheet as defined by the
	appropriate specifications, it supports all the features defined
	by this specification by parsing them correctly
	and rendering the document accordingly. However, the inability of a
	UA to correctly render a document due to limitations of the device
	does not make the UA non-conformant. (For example, a UA is not
	required to render color on a monochrome monitor.) </p>
  <p>An authoring tool is conformant to this specification
	if it writes style sheets that are syntactically correct according to the
	generic CSS grammar and the individual grammars of each feature in
	this module, and meet all other conformance requirements of style sheets
	as described in this module. </p>
  <h3 class="heading settled" id="conform-responsible"><span class="content"> Requirements for Responsible Implementation of CSS</span><a class="self-link" href="#conform-responsible"></a></h3>
  <p>The following sections define several conformance requirements
		for implementing CSS responsibly,
		in a way that promotes interoperability in the present and future. </p>
  <h4 class="heading settled" id="conform-partial"><span class="content"> Partial Implementations</span><a class="self-link" href="#conform-partial"></a></h4>
  <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, <strong>CSS renderers <em>must</em> treat as invalid
		(and <a href="http://www.w3.org/TR/CSS2/conform.html#ignore">ignore as appropriate</a>)
		any at-rules, properties, property values, keywords, and other syntactic constructs
		for which they have no usable level of support</strong>.
		In particular, user agents <em>must not</em> selectively ignore
		unsupported property values and honor supported values in a single multi-value property declaration:
		if any value is considered invalid (as unsupported values must be),
		CSS requires that the entire declaration be ignored. </p>
  <h4 class="heading settled" id="conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#conform-future-proofing"></a></h4>
  <p>To avoid clashes with future stable CSS features,
		the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p>
  <h4 class="heading settled" id="conform-testing"><span class="content"> Implementations of CR-level Features</span><a class="self-link" href="#conform-testing"></a></h4>
  <p>Once a specification reaches the Candidate Recommendation stage,
		implementers should release an <a data-link-type="dfn" href="http://www.w3.org/TR/CSS/#vendor-prefix">unprefixed</a> implementation
		of any CR-level feature they can demonstrate
		to be correctly implemented according to spec,
		and should avoid exposing a prefixed variant of that feature. </p>
  <p>To establish and maintain the interoperability of CSS across
		implementations, the CSS Working Group requests that non-experimental
		CSS renderers submit an implementation report (and, if necessary, the
		testcases used for that implementation report) to the W3C before
		releasing an unprefixed implementation of any CSS features. Testcases
		submitted to W3C are subject to review and correction by the CSS
		Working Group. </p>
  <p>
   Further information on submitting testcases and implementation reports
		can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
		Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list. 
<script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script>
  </p>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li><a href="#funcdef-env">env()</a><span>, in §3</span>
   <li><a href="#css-environment-variable">environment variable</a><span>, in §2</span>
   <li><a href="#valdef-env-safe-area-inset-bottom">safe-area-inset-bottom</a><span>, in §2.1</span>
   <li><a href="#valdef-env-safe-area-inset-left">safe-area-inset-left</a><span>, in §2.1</span>
   <li><a href="#valdef-env-safe-area-inset-right">safe-area-inset-right</a><span>, in §2.1</span>
   <li><a href="#valdef-env-safe-area-inset-top">safe-area-inset-top</a><span>, in §2.1</span>
   <li><a href="#substitute-an-env">substitute</a><span>, in §3</span>
   <li><a href="#substitute-an-env">substitute an env()</a><span>, in §3</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-shorthand-property">
   <a href="https://drafts.csswg.org/css-cascade-4/#shorthand-property">https://drafts.csswg.org/css-cascade-4/#shorthand-property</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-shorthand-property">3.1. Environment Variables in Shorthand Properties</a> <a href="#ref-for-shorthand-property①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-at-ruledef-media">
   <a href="https://drafts.csswg.org/css-conditional-3/#at-ruledef-media">https://drafts.csswg.org/css-conditional-3/#at-ruledef-media</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-at-ruledef-media">1. Introduction</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedef-declaration-value">
   <a href="https://drafts.csswg.org/css-syntax-3/#typedef-declaration-value">https://drafts.csswg.org/css-syntax-3/#typedef-declaration-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-declaration-value">2. Environment Variables</a>
    <li><a href="#ref-for-typedef-declaration-value①">3. Using Environment Variables: the env() notation</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-at-rule">
   <a href="https://drafts.csswg.org/css-syntax-3/#at-rule">https://drafts.csswg.org/css-syntax-3/#at-rule</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-at-rule">3. Using Environment Variables: the env() notation</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-length-value">
   <a href="https://drafts.csswg.org/css-values-3/#length-value">https://drafts.csswg.org/css-values-3/#length-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-length-value">2.1. Safe area inset variables</a> <a href="#ref-for-length-value①">(2)</a> <a href="#ref-for-length-value②">(3)</a> <a href="#ref-for-length-value③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-comma">
   <a href="https://drafts.csswg.org/css-values-4/#comb-comma">https://drafts.csswg.org/css-values-4/#comb-comma</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-comma">3. Using Environment Variables: the env() notation</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-identifier-value">
   <a href="https://drafts.csswg.org/css-values-4/#identifier-value">https://drafts.csswg.org/css-values-4/#identifier-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-identifier-value">3. Using Environment Variables: the env() notation</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-mult-opt">
   <a href="https://drafts.csswg.org/css-values-4/#mult-opt">https://drafts.csswg.org/css-values-4/#mult-opt</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mult-opt">3. Using Environment Variables: the env() notation</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedef-custom-property-name">
   <a href="https://drafts.csswg.org/css-variables-1/#typedef-custom-property-name">https://drafts.csswg.org/css-variables-1/#typedef-custom-property-name</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-custom-property-name">2. Environment Variables</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-custom-property">
   <a href="https://drafts.csswg.org/css-variables-1/#custom-property">https://drafts.csswg.org/css-variables-1/#custom-property</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-custom-property">1. Introduction</a> <a href="#ref-for-custom-property①">(2)</a> <a href="#ref-for-custom-property②">(3)</a>
    <li><a href="#ref-for-custom-property③">2. Environment Variables</a>
    <li><a href="#ref-for-custom-property④">3. Using Environment Variables: the env() notation</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-invalid-at-computed-value-time">
   <a href="https://drafts.csswg.org/css-variables-1/#invalid-at-computed-value-time">https://drafts.csswg.org/css-variables-1/#invalid-at-computed-value-time</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-invalid-at-computed-value-time">3. Using Environment Variables: the env() notation</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-funcdef-var">
   <a href="https://drafts.csswg.org/css-variables-1/#funcdef-var">https://drafts.csswg.org/css-variables-1/#funcdef-var</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-var①">1. Introduction</a> <a href="#ref-for-funcdef-var②">(2)</a> <a href="#ref-for-funcdef-var③">(3)</a> <a href="#ref-for-funcdef-var④">(4)</a>
    <li><a href="#ref-for-funcdef-var⑤">3. Using Environment Variables: the env() notation</a> <a href="#ref-for-funcdef-var⑥">(2)</a> <a href="#ref-for-funcdef-var⑦">(3)</a>
    <li><a href="#ref-for-funcdef-var⑧">3.1. Environment Variables in Shorthand Properties</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-document">
   <a href="https://dom.spec.whatwg.org/#document">https://dom.spec.whatwg.org/#document</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-document">2. Environment Variables</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[css-cascade-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-shorthand-property" style="color:initial">shorthand property</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-conditional-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-at-ruledef-media" style="color:initial">@media</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-syntax-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-typedef-declaration-value" style="color:initial">&lt;declaration-value></span>
     <li><span class="dfn-paneled" id="term-for-at-rule" style="color:initial">at-rule</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-values-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-length-value" style="color:initial">&lt;length></span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-values-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-comb-comma" style="color:initial">,</span>
     <li><span class="dfn-paneled" id="term-for-identifier-value" style="color:initial">&lt;custom-ident></span>
     <li><span class="dfn-paneled" id="term-for-mult-opt" style="color:initial">?</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-variables-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-typedef-custom-property-name" style="color:initial">&lt;custom-property-name></span>
     <li><span class="dfn-paneled" id="term-for-custom-property" style="color:initial">custom property</span>
     <li><span class="dfn-paneled" id="term-for-invalid-at-computed-value-time" style="color:initial">invalid at computed-value time</span>
     <li><span class="dfn-paneled" id="term-for-funcdef-var" style="color:initial">var()</span>
    </ul>
   <li>
    <a data-link-type="biblio">[DOM]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-document" style="color:initial">Document</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-css-cascade-4">[CSS-CASCADE-4]
   <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://www.w3.org/TR/css-cascade-4/">CSS Cascading and Inheritance Level 4</a>. 28 August 2018. CR. URL: <a href="https://www.w3.org/TR/css-cascade-4/">https://www.w3.org/TR/css-cascade-4/</a>
   <dt id="biblio-css-conditional-3">[CSS-CONDITIONAL-3]
   <dd>CSS Conditional Rules Module Level 3 URL: <a href="https://www.w3.org/TR/css3-conditional/">https://www.w3.org/TR/css3-conditional/</a>
   <dt id="biblio-css-syntax-3">[CSS-SYNTAX-3]
   <dd>Tab Atkins Jr.; Simon Sapin. <a href="https://www.w3.org/TR/css-syntax-3/">CSS Syntax Module Level 3</a>. 20 February 2014. CR. URL: <a href="https://www.w3.org/TR/css-syntax-3/">https://www.w3.org/TR/css-syntax-3/</a>
   <dt id="biblio-css-values-3">[CSS-VALUES-3]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-3/">CSS Values and Units Module Level 3</a>. 31 January 2019. CR. URL: <a href="https://www.w3.org/TR/css-values-3/">https://www.w3.org/TR/css-values-3/</a>
   <dt id="biblio-css-values-4">[CSS-VALUES-4]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-4/">CSS Values and Units Module Level 4</a>. 31 January 2019. WD. URL: <a href="https://www.w3.org/TR/css-values-4/">https://www.w3.org/TR/css-values-4/</a>
   <dt id="biblio-css-variables-1">[CSS-VARIABLES-1]
   <dd>Tab Atkins Jr.. <a href="https://www.w3.org/TR/css-variables-1/">CSS Custom Properties for Cascading Variables Module Level 1</a>. 3 December 2015. CR. URL: <a href="https://www.w3.org/TR/css-variables-1/">https://www.w3.org/TR/css-variables-1/</a>
   <dt id="biblio-dom">[DOM]
   <dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/">DOM Standard</a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
  <div style="counter-reset:issue">
   <div class="issue"> Is the set of UA-defined <a data-link-type="dfn" href="#css-environment-variable">environment variables</a> visible to script?
If so, define an API on <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code> to expose them.<a href="#issue-c17a17b4"> ↵ </a></div>
   <div class="issue"> Define how authors can add <a data-link-type="dfn" href="#css-environment-variable">environment variables</a>,
preferably both via JS
and via CSS.
Note that mixing CSS rules and JS-defined stuff can easily get messy,
as demonstrated by CSSFontFaceRule vs FontFace...<a href="#issue-ed0904e4"> ↵ </a></div>
   <div class="issue">
     Define the full set of places <a class="css" data-link-type="maybe" href="#funcdef-env">env()</a> can be used. 
    <ul>
     <li data-md>
      <p>Should be able to replace any subset of MQ syntax, for example.</p>
     <li data-md>
      <p>Should be able to replace selectors, maybe?</p>
     <li data-md>
      <p>Should it work on a rule level,
so you can insert arbitrary stuff into a rule,
like reusing a block of declarations?</p>
    </ul>
    <a href="#issue-9ee89738"> ↵ </a>
   </div>
   <div class="issue"> Define when substitution happens.
It has to be before <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-variables-1/#funcdef-var">var()</a> substitution.
Alternately, should <a class="css" data-link-type="maybe" href="#funcdef-env">env()</a> substitution happen at parse time,
so unknown variable names cause it to fail syntax checking?
There’s no particular reason to have it happen at computed-value time,
like <span class="css">var()</span> does—<wbr>that was to ensure that <a data-link-type="dfn" href="https://drafts.csswg.org/css-variables-1/#custom-property">custom properties</a> could inherit their value down
before they were picked up by a <span class="css">var()</span>.<a href="#issue-91e85376"> ↵ </a></div>
   <div class="issue"> When I figure out where else <a class="css" data-link-type="maybe" href="#funcdef-env">env()</a> can go,
define how/when it substitutes.<a href="#issue-9806265e"> ↵ </a></div>
   <div class="issue"> If <a class="css" data-link-type="maybe" href="#funcdef-env">env()</a> substitution happens during parsing,
then this is unnecessary.<a href="#issue-66b99b40"> ↵ </a></div>
  </div>
  <aside class="dfn-panel" data-for="css-environment-variable">
   <b><a href="#css-environment-variable">#css-environment-variable</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-css-environment-variable①">1. Introduction</a> <a href="#ref-for-css-environment-variable②">(2)</a> <a href="#ref-for-css-environment-variable③">(3)</a> <a href="#ref-for-css-environment-variable④">(4)</a>
    <li><a href="#ref-for-css-environment-variable⑤">2. Environment Variables</a> <a href="#ref-for-css-environment-variable⑥">(2)</a> <a href="#ref-for-css-environment-variable⑦">(3)</a> <a href="#ref-for-css-environment-variable⑧">(4)</a> <a href="#ref-for-css-environment-variable⑨">(5)</a>
    <li><a href="#ref-for-css-environment-variable①⓪">2.1. Safe area inset variables</a>
    <li><a href="#ref-for-css-environment-variable①①">3. Using Environment Variables: the env() notation</a> <a href="#ref-for-css-environment-variable①②">(2)</a> <a href="#ref-for-css-environment-variable①③">(3)</a> <a href="#ref-for-css-environment-variable①④">(4)</a> <a href="#ref-for-css-environment-variable①⑤">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-env">
   <b><a href="#funcdef-env">#funcdef-env</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-env①">1. Introduction</a> <a href="#ref-for-funcdef-env②">(2)</a>
    <li><a href="#ref-for-funcdef-env③">3. Using Environment Variables: the env() notation</a> <a href="#ref-for-funcdef-env④">(2)</a> <a href="#ref-for-funcdef-env⑤">(3)</a> <a href="#ref-for-funcdef-env⑥">(4)</a> <a href="#ref-for-funcdef-env⑦">(5)</a> <a href="#ref-for-funcdef-env⑧">(6)</a> <a href="#ref-for-funcdef-env⑨">(7)</a> <a href="#ref-for-funcdef-env①⓪">(8)</a> <a href="#ref-for-funcdef-env①①">(9)</a> <a href="#ref-for-funcdef-env①②">(10)</a> <a href="#ref-for-funcdef-env①③">(11)</a> <a href="#ref-for-funcdef-env①④">(12)</a> <a href="#ref-for-funcdef-env①⑤">(13)</a> <a href="#ref-for-funcdef-env①⑥">(14)</a> <a href="#ref-for-funcdef-env①⑦">(15)</a> <a href="#ref-for-funcdef-env①⑧">(16)</a> <a href="#ref-for-funcdef-env①⑨">(17)</a>
    <li><a href="#ref-for-funcdef-env②⓪">3.1. Environment Variables in Shorthand Properties</a> <a href="#ref-for-funcdef-env②①">(2)</a> <a href="#ref-for-funcdef-env②②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="substitute-an-env">
   <b><a href="#substitute-an-env">#substitute-an-env</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-substitute-an-env">3. Using Environment Variables: the env() notation</a> <a href="#ref-for-substitute-an-env①">(2)</a> <a href="#ref-for-substitute-an-env②">(3)</a>
   </ul>
  </aside>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>